/**
 * Created by graysoft on 2017/2/14.
 */
"use strict";

import React from "react";
import ReactDOM from "react-dom";
import $ from "jquery";

class App extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            address:null
        };
    }

    componentWillMount(){
        console.log("component will mount");
        this.setState({
            address:"WillMount"
        });
        console.log("component will mount 1");
        this.setState({
            address:"WillMount1"
        });
        console.log(this.state.address);
        this.setState({
            address:"WillMount2"
        });
        console.log(this.state.address);

    }

    componentDidMount(){
        let App = ReactDOM.findDOMNode(this);

        $(App).click(function(){
            var outHtml = App.innerHTML;
            console.log(outHtml);
        });
    }

    render(){
        return <h2>点击标题触发事件</h2>;
    }
}

ReactDOM.render(
    <App />,
    document.getElementById("root")
)